package com.quan.aweb.service;

import com.quan.aweb.client.bClient;
import com.quan.aweb.dao.IJobStPfbzDao;
import com.quan.aweb.entity.User;
import com.quan.aweb.interfaces.userInterface;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;
import org.springframework.data.redis.core.RedisTemplate;

import javax.transaction.Transactional;
import java.util.UUID;

@Service
public class userService implements userInterface {
    @Autowired
    private bClient bClient;

//    @Autowired
//    private RedisTemplate redisTemplate;

    @Autowired
    IJobStPfbzDao jobStPfbzDao;

    //    @Autowired(required=false)
//    private MongoTemplate mongoTemplate;
    @Override
//    @GlobalTransactional
    public User getUser(String id) {
//        redisTemplate.opsForValue().set("key", "newValue");
//        String value = (String) redisTemplate.opsForValue().get("key");

       /* User user = new User();
        user.setRid(UUID.randomUUID().toString());
        user.setName("lu");*/
//        jobStPfbzDao.save(user);
//        jobStPfbzDao.findAll();

        //System.out.println(value.toString());
        return bClient.getUser("1");
    }


}
